package homework20.com.neuedu.main;

import homework19.Game;
import homework20.com.neuedu.views.SystemView;

import java.util.Scanner;

public class App {
    public static void main(String[] args) throws Exception {
        Game game = new Game();
        while (true) {
            SystemView.view();
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            switch (a) {
                case 1:
                    System.out.println("请选择添加的物品名称");
                    String b = scanner.next();
                    game.addGoods(b);
                    break;
                case 2:
                    System.out.println("请选择第几个物品");
                    int a1 = scanner.nextInt();
                    System.out.println("请输入被修改的物品名称");
                    String b1 = scanner.next();
                    game.updateGoods(a1, b1);
                    break;
                case 3:
                    System.out.println("请选择删除第几个物品");
                    int a2 = scanner.nextInt();
                    game.deleteGoods(a2);
                    break;
                case 4:
                    game.findGoodsS();
                    break;

                default:
                    System.out.println("退出....");
                    System.exit(0);
            }


        }
    }
}